1. Field of the Invention
The present invention relates to a method and related apparatus for verifying a disk array, and more particularly, to a method and related apparatus for verifying a disk array according to verification commands instead of data configuration of the disk array.
2. Description of the Prior Art
Computer systems are indispensable to the information society. With computer systems, it is convenient for users to calculate, access, and manage a large amount of information, data, and audio/video at high speed. Therefore, information technology manufacturers have been devoted to improving the performance of computer systems to manage data more securely and speedily.
A hard disk is one type of non-volatile storage device and is popularly used in a computer system. With the falling costs and increasing capacities of hard disks, the current computer system is capable of integrating a plurality of hard disks into a disk array for accessing data. For instance, a redundant array of inexpensive disks (RAID) system has different data configurations, such as RAID 0, and RAID 2 to RAID 5. When performing a writing control to write data into the disk array, the data is striped into a plurality of sub-data (i.e. data stripes) in a stripe-like manner, and then each sub-data is respectively written to different disks of the disk array. Similarly, while reading this data from the disk array, each sub-data is simultaneously read from different disks of the disk array and combined to obtain the original data again. Additionally, disk array data configurations includes SPAN/JBOD (just a bunch of disks) configuration. In this configuration, storage space of each disk is connected one by one. In other words, data is stored in the first hard disk first. If the first hard disk has no storage space to store data, data will be stored in the second hard disk. In this manner, disks of SPAN/JBOD configuration are “sequentially” connected to form a larger storage space. That is, storage space of the first hard disk is regarded as the first part of the entire storage space, and storage space of the second hard disk is regarded as the second part of the entire storage space.
As known in the art, the hard disk/disk array should be verified to ensure that data can be correctly accessed in the hard disk/disk array. Generally, when the hard disk/disk array is formatted or a disk scan is performed, the hard disk/disk array is verified to ensure each part of the hard disk/disk array can store and access data correctly. Verifying the hard disk usually takes a quite amount of time. Due to many hard disks being in the disk array, verifying all hard disks of the disk array takes more time. However, verifying a disk array is necessary for ensuring data security and integrity. Therefore, how to increase the verification efficiency of a disk array is an important issue for information technology manufacturers.
In the prior art, the verification is executed according to data configuration of the disk array. For instance, a striped RAID is composed of N hard disks. Data stored in such a striped RAID is separated into N parts, each part including 1/N information of the data and respectively stored in different hard disks of the disk array. When verifying M sectors (or bytes) of the disk array, the prior art respectively verifies M/N sectors of each hard disk in the disk array composed of N hard disks. According to RAID data configuration, integrating M/N sectors of each hard disk that are already verified is equivalent to verifying M sectors in the disk array. After M sectors of the disk array are verified, the disk array continues verifying another M sectors until the entire storage space of the disk array is verified.
However, there are some drawbacks in verifying a disk array according to the prior art. For instance, the prior art has to frequently verify each hard disk. When a hard disk is being verified, the computer system sends a hard disk verification command, such as a read verification command conforming to advanced technology attachment (ATA), to the disk to indicate which part should be verified and the size of the storage capacity to be verified. Here, the verifying storage capacity specified in a single hard disk verification command has an uplimit, i.e., a maximum storage space. That is, if the maximum storage space to be verified is K sectors, each single hard disk verification command verifies K sectors at most in a hard disk. However, when verifying storage space, storage space to be verified is usually less than the maximum verification storage space allowed in a single hard disk verification command. As mentioned above, when verifying M sectors in the disk array, the prior art uses a hard disk verification command to verify M/N sectors of a hard disk. However, M/N sectors are usually less than K sectors, the maximum verification storage space of a single hard disk verification command. Therefore, the prior art must send more hard disk verification commands to completely verify a hard disk in that storage space to be verified. Each hard disk verification command according to the prior art is less than the maximum verification storage space of a single hard disk verification command. This reduces the computer system performance and the efficiency of verifying a disk array.
Additionally, in SPAN/JBOD data configuration, the first hard disk of the disk array is regarded as the first part of the entire storage space, and the second hard disk of the disk array is taken as the second part of the entire storage space. In this case, after the prior art verifies the first hard disk completely, the second hard disk gets verified. Also, this takes a lot of time to verify the entire disk array, and the required time is equal to a sum of the durations to verify each hard disk.